cmake_path(GET CMAKE_CURRENT_SOURCE_DIR STEM PluginName)
project(${PluginPrefix}${PluginName})

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

file(GLOB_RECURSE sources ./src/*.cc ./src/*.h)

add_library(${PROJECT_NAME} SHARED
        ${sources}
)

target_include_directories(${PROJECT_NAME}
        PUBLIC include
)

string(TOUPPER ${PluginName} UpperPluginName)
string(TOUPPER ${PluginName}_PLUGIN_LIB PluginExportMacro)
target_compile_definitions(${PROJECT_NAME}
        PRIVATE "${PluginExportMacro}"
)

target_link_libraries(${PROJECT_NAME}
        PRIVATE Ces
        PRIVATE Qt5::Widgets
        PRIVATE Qt5::Gui
)

#set_target_properties(${PROJECT_NAME} PROPERTIES
#    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugin
#    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/plugin
#    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugin
#)
